package com.gticket.buyticket.handler;

import com.gticket.buyticket.pojo.Cinema;
import com.gticket.buyticket.pojo.Movie;
import com.gticket.buyticket.service.CinemasService;
import com.gticket.buyticket.service.MovieInfoService;
import lombok.Data;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Data
@RestController
public class CinemasHandler {

    @Resource
    private CinemasService cinemasService;

    //获取所有电影院
	@CrossOrigin(origins = "*")
    @GetMapping("/cinemas")
    public List<Cinema> getCinemas(){
        return cinemasService.getCinemas();
    }

    //获取单个电影院
	@CrossOrigin(origins = "*")
    @GetMapping("/cinema")
    public Cinema getCinemaInfo(Cinema cinema){
        return cinemasService.getCinemaInfo(cinema);
    }

}
